import java.util.Objects;

class Data {
    Integer key;
    String data;

    public Data(Integer key, String data) {
        this.key = key;
        this.data = data;
    }

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Data)) return false;
        Data data1 = (Data) o;
        return getKey().equals(data1.getKey()) &&
                getData().equals(data1.getData());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getKey(), getData());
    }

    @Override
    public String toString() {
        return "Data{" +
                "key=" + key +
                ", data='" + data + '\'' +
                '}';
    }
}